import {App} from "vue"
import {app} from "./main"

interface Use {
  install: (app:App, ...options:any[]) => void
}

const installList = new Set()

export function MyUse<T extends Use>(plugin: T, ...options:any[]) {
  console.log(plugin)
  if(installList.has(plugin)) {
    console.error(`插件${plugin}已经安装`)
  } else {
    plugin.install(app, ...options)
    installList.add(plugin)
  }
}